package br.edu.ufcg.splab.techniques.reduction.functions.choice;

import br.edu.ufcg.splab.generator.TestCase;

public class RandomTestCases implements ChoiceFunction{
	private TestCase firstChoose;
	private TestCase secondChoose;
	
	public RandomTestCases(){
		firstChoose = new TestCase();
		secondChoose = new TestCase();
	}
	
	public void defineOrderChoice(TestCase tc1, TestCase tc2){
		if (Math.random() < 0.5) {
            firstChoose = tc1;
            secondChoose = tc2;
        } else {
            firstChoose = tc2;
            secondChoose = tc1;
        }		
	}
	
	public TestCase firstChoice(){
		return firstChoose;
	}
	
	public TestCase secondChoice(){
		return secondChoose;
	}
	
	/**
     * Provide a string representation of the choice function to be written.
     * @return The string representation of the choice function.
     */
	public String getFunction(){
		return "Rnd";
	}
}
